home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / Getting Started / MPW Development / MPW Additions / INTO Interfaces&Libraries / Cyberdog SDK / PublicIncludes / CyberItem.idl < prev    next >
Encoding:
Text File  |  1996-08-02  |  5.3 KB  |  209 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        CyberItem.idl
  3.  
  4.     Contains:    xxx put contents here xxx
  5.  
  6.     Written by:    the cyberdogs
  7.  
  8.     Copyright:    © 1996 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.          <2>     5/29/96    mc        More embedding work
  13.         <21>     5/21/96    mc        Plug-in support
  14.  
  15.     To Do:
  16. */
  17.  
  18. #ifndef __CYBERITEM__
  19. #define __CYBERITEM__
  20.  
  21. #include "RefCtObj.idl"
  22. #include "CyberMisc.idl"
  23.  
  24. /*==============================================================================
  25. // Classes defined in this interface
  26. //=============================================================================*/
  27.  
  28. interface  CyberItem;
  29.  
  30.  
  31. /*==============================================================================
  32. // Classes used by this interface
  33. //=============================================================================*/
  34.  
  35. interface  ODDraft;
  36. interface  ODFrame;
  37. interface  ODPart;
  38. interface  ODSession;
  39. interface  ODStorageUnit;
  40. interface  ODWindow;
  41.  
  42. interface  CyberStream;
  43. interface  CyberSession;
  44. interface  ParameterSet;
  45.  
  46. /*==============================================================================
  47. // Types
  48. //=============================================================================*/
  49.  
  50.  
  51. #pragma somemittypes off
  52. typedef somToken    CyberResolveCompletionUPP;
  53.  
  54. #pragma somemittypes on
  55.  
  56. typedef sequence<CyberItem> CyberItemList;
  57. typedef ODOSType             CDStringProperty;
  58.  
  59. enum CDCompareType {
  60.     kCDCompareLessThan,
  61.     kCDCompareEqual,
  62.     kCDCompareGreaterThan
  63. };
  64.  
  65. enum CDItemInfoType {
  66.     kCDInfoDownload,
  67.     kCDInfoReference,
  68.     kCDInfoPart
  69. };
  70.  
  71.  
  72. /*==============================================================================
  73. // Constants
  74. //=============================================================================*/
  75.  
  76.     // String Properties
  77. const CDStringProperty     kCDDefaultName             = 0;
  78. const CDStringProperty     kCDHomeName             = 'HOME';
  79. const CDStringProperty     kCDWindowName             = 'WIND';
  80. const CDStringProperty     kCDLogName                 = 'LOG1';
  81. const CDStringProperty     kCDLog2ndCol             = 'LOG2';
  82. const CDStringProperty     kCDNotebookName         = 'NBK1';
  83. const CDStringProperty     kCDNotebook2ndCol         = 'NBK2';
  84. const CDStringProperty     kCDFileName             = 'FILE';
  85.  
  86.     // Parameter Key Names for CyberItem.Open()
  87. const string    kCDParentItemKey                = "Apple:ParentItem";
  88. const string    kCDInitialOpenerPartKey            = "Apple:InitialOpenerPart";
  89. const string    kCDObtainedOpenerPartKey        = "Apple:ObtainedOpenerPart";
  90. const string    kCDSearch4ExistingWindowKey        = "Apple:Search4ExistingWindow";
  91. const string    kCDRefreshKey                    = "Apple:Refresh";
  92. const string    kCDWidthKey                        = "Apple:Width";
  93. const string    kCDHeightKey                    = "Apple:Height";
  94. const string    kCDFrameSizeFixed                = "Apple:FrameSizeFixed";
  95. const string    kCDWaitForFrame                    = "Apple:WaitForFrame";
  96.  
  97.     // Bit numbers for CyberItem flags
  98. const long kCDFlagDontLog                        = 0;
  99. const long kCDFlagDontEmbed                        = 1;
  100.  
  101.     // Bit Masks for CyberItem flags
  102. const long kCDFlagDontLogMask                    = 0x00000001;
  103. const long kCDFlagDontEmbedMask                    = 0x00000002;
  104.  
  105.  
  106. /*==============================================================================
  107. // CyberItem
  108. //=============================================================================*/
  109.  
  110. interface CyberItem : ODRefCntObject
  111. {
  112.         void            ICyberItem();
  113.         void            Open(in ParameterSet theParams);
  114.         void            ShowInfoPart();
  115.         
  116.         void            SetUpFromURL(in char* url, in StringPtr defaultName, in ScriptCode defaultNameScript);
  117.                     
  118.             // For dragging, etc.    
  119.         void            ExternalizeContent(in ODStorageUnit su);
  120.         
  121.             // Subclasses must override
  122.         long            GetFlatSize();
  123.         long             Flatten(in Ptr buffer, in long length);        // returns amount written
  124.         long             Unflatten(in Ptr buffer);                        // returns amount read
  125.         
  126.             // Implemented by base class -- Don't override
  127.         void            StreamToStorageUnit(in ODStorageUnit su);
  128.  
  129.         CyberItem        Clone();
  130.             
  131.         CDCompareType    Compare(in CyberItem compare);        // base class compares Classes
  132.             
  133.         void            GetStringProperty(in CDStringProperty property, in StringPtr theString, out ScriptCode script);
  134.         void            SetDefaultName(in StringPtr defaultName, in ScriptCode script);
  135.             
  136.         char*            GetURL();
  137.             
  138.         Handle            GetIconSuite(in CDItemInfoType infoType);
  139.             
  140.         CyberStream        CreateCyberStream();
  141.         
  142.         
  143.             //    Base class returns kODTrue
  144.         ODBoolean        IsResolved();
  145.             //    Base class calls callback immediately
  146.         void            Resolve(in CyberResolveCompletionUPP completionProc, in void* userData, in ODPart progressPart);
  147.         
  148.         ODBoolean        IsDownloadable();
  149.         ODTypeToken        GetContentKind();
  150.         void            GetFileInfo(in CDItemInfoType infoType, out ODOSType flCreator, out ODOSType flType);
  151.  
  152.             //    Base class returns kODFalse
  153.         ODBoolean        IsSecure();
  154.         void            ShowSecurityInfo();
  155.         
  156.             //    Base class returns 0
  157.         long            GetFlags();
  158.         
  159.             //     Must be resolved.  Base class returns kODNULL
  160.         ODPart            CreatePart(in ODDraft draft);
  161.         
  162.  
  163. #ifdef __SOMIDL__
  164.     implementation
  165.     {
  166.       functionprefix = CyberItem__;
  167.  
  168.     override:
  169.         somInit,
  170.         somUninit,
  171.         Release;
  172.         
  173.     releaseorder:
  174.         ICyberItem,
  175.         Open,
  176.         Release,
  177.         SetUpFromURL,
  178.         GetFlatSize,
  179.         Flatten,
  180.         Unflatten,
  181.         ExternalizeContent,
  182.         StreamToStorageUnit,
  183.         Clone,
  184.         Compare,
  185.         GetStringProperty,
  186.         SetDefaultName,
  187.         GetURL,
  188.         GetIconSuite,
  189.         CreateCyberStream,
  190.         ShowInfoPart,
  191.         IsResolved,
  192.         Resolve,
  193.         IsDownloadable,
  194.         GetContentKind,
  195.         GetFileInfo,
  196.         IsSecure,
  197.         ShowSecurityInfo,
  198.         GetFlags,
  199.         CreatePart;
  200.  
  201.         passthru C_xh =     ""
  202.                             "#include \"CyberdogProcPtrs.h\""
  203.                             "";
  204.     };
  205. #endif
  206. };
  207.  
  208. #endif //__CYBERITEM__
  209.